<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use ms\modules\article\models\ArticleNav;
use common\models\BaseSite;
/* @var $this yii\web\View */
/* @var $model ms\modules\article\models\ArticleInfo */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="article-info-form">
    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput() ?>

    <?= $form->field($model, 'nav_id')->textInput(['maxlength' => 50]) ?>
	
	<?= $form->field($model, 'type')->textInput(['maxlength' => 50]) ?>
	 
    <?= $form->field($model, 'abstract')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'author')->textInput() ?>
	<h1>封面图</h1>
    <?= $form->field($model, 'img_id')->textInput() ?>

    <?= $form->field($model, 'click_num')->textInput() ?>

    <?= $form->field($model, 'content')->textInput() ?>

    <?= $form->field($model, 'icon')->textInput() ?>

    <?= $form->field($model, 'status')->textInput() ?>
    
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>
    <?php ActiveForm::end(); ?>
</div>
<script>
    //citys[0][]
    //全部选择
    $("#choseAll").click(function(){
        $("input[name='site_id[]']").each(function(){
            this.checked = true;
        });
    });
    //取消选择
    $("#delAll").click(function(){
        $("input[name='site_id[]']").each(function(){
            this.checked = false;
        });
    });
    $("#fanAll").click(function(){
        $("input[name='site_id[]']").each(function(){
            if(this.checked == false){
                this.checked = true;
            }else{
                this.checked = false;
            }
        });
    });
</script>